package com.qd.common.panda.domain.entity.stroke;

import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 充电订单
 *
 * @author sjk
 */
@Getter
@Setter
@ToString
public class UserStrokeOrderChargeDTO {

    /**
     * 主键
     */
    @Size(max = 50, message = "订单ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String orderId;
    /**
     * 充电量
     */
    private BigDecimal chargeCapacity;
    /**
     * 充电量显示
     */
    private String chargeCapacityDisplay;
    /**
     * 订单状态:充电订单状态:1：启动中,2：充电中,3：停止中,4：已结束,5：未知
     */
    private Integer state;
    /**
     * 剩余电量
     */
    private Integer soc;
    /**
     * 订单状态显示
     */
    private String stateDisplay;
    /**
     * 电费
     */
    private BigDecimal electricityFee;
    /**
     * 电费显示
     */
    private String electricityFeeDisplay;
    /**
     * 服务费
     */
    private BigDecimal serviceCharge;
    /**
     * 服务费显示
     */
    private String serviceChargeDisplay;
    /**
     * 总金额
     */
    private BigDecimal totalAmount;
    /**
     * 总金额显示
     */
    private String totalAmountDisplay;
    /**
     * 充电开始时间
     */
    private LocalDateTime startTime;
    /**
     * 充电结束时间
     */
    private LocalDateTime endTime;
    /**
     * 行程ID
     */
    @Size(max = 50, message = "行程ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String sid;
    /**
     * 运营商编号
     */
    @JsonProperty("operatorID")
    private String operatorID;
    /**
     * 设备接口编号
     */
    @JsonProperty("connectorID")
    private String connectorID;
    /**
     * 充电时长，分钟数
     */
    private Long chargeTime;

    public void freeData() {
        this.orderId = null;
        this.chargeCapacity = null;
        this.chargeCapacityDisplay = null;
        this.state = null;
        this.soc = null;
        this.stateDisplay = null;
        this.electricityFee = null;
        this.electricityFeeDisplay = null;
        this.serviceCharge = null;
        this.serviceChargeDisplay = null;
        this.totalAmount = null;
        this.totalAmountDisplay = null;
        this.startTime = null;
        this.endTime = null;
        this.sid = null;
        this.operatorID = null;
        this.chargeTime = null;
        this.connectorID = null;
    }
}
